<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title>TitlePane Test</title>

	<style type="text/css">
		@import "../../../themes/claro/document.css";
		@import "../../css/dijitTests.css";
	</style>

	<link id="themeStyles" rel="stylesheet" href="../../../themes/claro/claro.css"/>
	<script type="text/javascript" src="../../../../dojo/dojo.js"
		data-dojo-config="async: true, has: { 'dojo-bidi': true }"></script>

	<script type="text/javascript">
		require([
			"doh/runner",
			"dojo/dom",
			"dojo/parser",
			"dojo/query",
			"dijit/registry",
			"dijit/TitlePane",
			"dojo/domReady!"
		], function(doh, dom, parser, query, registry){

			doh.register("parse", function(){
				return parser.parse();
			});

			doh.register("tests._BidiSupport.misc.TitlePane.Bidi", [
				{
					name: "TitlePane Bidi",
					runTest: function(){
						registry.byId("pane_2").set('textDir', "rtl");
						doh.is("rtl", registry.byId("pane_1").titleNode.dir, "title node had direction correspondent to 'textDir'");
						doh.is("rtl", registry.byId("pane_2").titleNode.dir, "title node had direction correspondent to 'textDir'");
					}
				}
			]);

			doh.register("log", function(){
				dom.byId('failures').innerHTML = doh._failureCount;
				dom.byId('errors').innerHTML = doh._errorCount;
			});

			doh.run();
		});
	</script>
</head>
<body class="claro">
	<h1 class="testTitle"><b>Bidi TitlePane Test</b></h1>
	<h1>Title pane with tooltip, textDir == 'auto'</h1>
	<div id="pane_1" data-dojo-id="pane1" data-dojo-type="dijit/TitlePane" data-dojo-props='textDir:"auto", title:"\u05e9\u05dc\u05d5\u05dd Title Pane!",
		tooltip:"\u05e9\u05dc\u05d5\u05dd I\"m the tooltip for Title Pane\"s title bar!",
		style:"width: 500px;" '>
		Arabic, Hebrew, Urdu, and Farsi (Persian) are written from right to left,
		while numbers and segments of Latin (or Cyrillic or Greek) text are embedded in
		this text from left to right. The dual directionality aspects of such
		bidirectional (bidi) text are posing challenges to the way this text is processed and presented in computer applications.

	</div>
	<h1>Title pane, textDir == 'rtl'</h1>
	<div id="pane_2" data-dojo-type="dijit/TitlePane" data-dojo-props='title:"Title Pane!", textDir:"ltr", tooltip:"Title Pane!", style:"width: 500px;"'>
		The Unicode Bidirectional Algorithm, which is commonly used for preparation of Bidi text for display,
		is not capable to reliably identify the natural base text direction for a given text.
		Only a human reader can unfailingly recognize the natural base text direction for a given text.
		Support for enforcing the base text direction is provided out of the box by most platforms / technologies,
		but very often the default settings do not guarantee proper display of English and Arabic/Hebrew text in the
		same application.	See for reference:	http://w3-03.ibm.com/globalization/page/publish/4353
	</div>
	<br>Errors:&nbsp;<span id="errors">?</span>
	<br>Failures:&nbsp;<span id="failures">?</span>
</body>
</html>
